package com.ciis.system.org.service.impl;

import com.ciis.base.page.IPage;
import com.ciis.system.org.domain.TSysOrg;
import com.ciis.system.org.mapper.ITSysOrgMapper;
import com.ciis.system.org.service.ISysOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: zhangdajun
 * Date: 14-5-22
 * Time: 下午8:32
 * To change this template use File | Settings | File Templates.
 */
@Service("sysOrgService")
public class SysOrgServiceImpl implements ISysOrgService {

    @Autowired
    ITSysOrgMapper sysOrgMapper;

    @Override
    public void save(TSysOrg org) throws Exception {
        sysOrgMapper.save(org);
    }

    @Override
    public void update(TSysOrg org) throws Exception {
        sysOrgMapper.update(org);
    }

    @Override
    public void delete(String ids) throws Exception {
        String idArray[] = ids.split(",");
        for(String id : idArray){
            sysOrgMapper.delete(id);
        }
    }

    @Override
    public List<TSysOrg> getList(String id) throws Exception {
        return null;
    }

    public IPage<TSysOrg> getListForPage(IPage<TSysOrg> sysOrgs,TSysOrg params) throws Exception{
        params.setId("idsssss");
        return sysOrgMapper.findPage(sysOrgs,params);
    }
}
